/*
 * @Description: 单个item组件
 * @Author: buwei.huang
 * @Date: 2019-07-12 14:48:22
 * @Last Modified by: buwei.huang
 * @Last Modified time: 2019-09-10 15:52:05
 */
<template>
  <div
    class="item_wrap flex-h flex-vc"
    :class="index == 0 ? 'item_wrap_bg' : ''"
    @click="onStartSite"
  >
    <i class="icon iconfont icon-mypoint baseColorNoAcitve fontsize44" />
    <div class="item_center flex1">
      <p>{{item.name}}</p>
      <p>{{item.address}}</p>
    </div>
    <i class="icon fontsize28 iconfont icon-circle baseColorNoAcitve" />
  </div>
</template>
<script>
export default {
  props: {
    item: {
      type: Object,
      default: null
    },
    index: {
      type: Number,
      default: null
    },
    routeType: {
      type: String,
      default: ''
    }
  },
  methods: {
    // 设为起点
    onStartSite() {
      console.log(this.item)
      // this.$AppRouterUtils.goBack(this.routeType + '&NAME=' + data.name + '&LONGITUDE=' + data.location.lng + '&LATITUDE=' + data.location.lat)
      let data = {
        NAME: this.item.name,
        LONGITUDE: this.item.location.lng,
        LATITUDE: this.item.location.lat
      }
      this.$EventBus.$emit('siteName', data)
      this.$router.push({ name: 'customBusHome' })
    }
  }
}
</script>
<style>
.item_wrap {
  height: 144px;
  background-color: #fff;
  padding: 0 32px;
}
.item_wrap .icon {
  margin: 0 34px 0 2px;
}
.item_wrap > button {
  width: 160px;
  height: 52px;
  font-size: 16px; /* no */
  color: #fff;
  border: none;
  border-radius: 4px;
  line-height: 52px;
}
.item_center > p {
  width: 578px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item_center > p:nth-of-type(1) {
  font-size: 16px; /* no */
  color: rgba(0, 0, 0, 0.87);
  line-height: 48px;
  margin-bottom: 8px;
}
.item_center > p:nth-of-type(2) {
  font-size: 14px; /* no */
  color: rgba(0, 0, 0, 0.54);
  line-height: 40px;
}
.item_wrap_bg {
  background-color: #f9f9f9;
}
</style>
